From: Marco Trevisan (TreviƱo) Date: Fri, 31 Oct 2025 03:57:50 +0000 (+0100) Subject: overviewControls: Bind state adjustment signals to parent lifetime X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~139 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=935c5a0c540237ea7d1b8e38141577ac20669662;p=gnome-shell.git overviewControls: Bind state adjustment signals to parent lifetime On tests shutdown we were sometimes getting this error: ** Message: 09:29:27.494: Shutting down GNOME Shell (gnome-shell:3728700): Gjs-CRITICAL **: 09:29:27.545: JS ERROR: TypeError: this._workspacesDisplay is undefined _update@resource:///org/gnome/shell/ui/overviewControls.js:599:37 _initializeUI/<@resource:///org/gnome/shell/ui/main.js:279:14 Which after using the arrow function becomes: (gnome-shell:3731979): Gjs-CRITICAL **: 09:30:05.419: JS ERROR: TypeError: this._workspacesDisplay is undefined _update@resource:///org/gnome/shell/ui/overviewControls.js:599:37 _init/<@resource:///org/gnome/shell/ui/overviewControls.js:343:67 _initializeUI/<@resource:///org/gnome/shell/ui/main.js:279:14 This is because the state adjustement object lifetime is not bound to the ControlsManager, and so we were potentially accessing to invalid data Part-of: --- diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index b8f789925..5d6708ee6 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -340,7 +340,8 @@ class ControlsManager extends St.Widget { this._workspaceAdjustment = Main.createWorkspacesAdjustment(this); this._stateAdjustment = new OverviewAdjustment(this); - this._stateAdjustment.connect('notify::value', this._update.bind(this)); + this._stateAdjustment.connectObject('notify::value', + () => this._update(), this); this._searchController = new SearchController.SearchController( this._searchEntry,